#include "src/manager/IMManager.h"
#include <QUrl>
#include <QMetaEnum>
#include <QThreadPool>
#include <QCoreApplication>
#include <QEventLoop>
#include <QLocale>
#include <QSysInfo>
#include <src/helper/SettingsHelper.h>

IMManager::IMManager(QObject *parent)
    : QObject{parent}
{
}

IMManager::~IMManager(){
}

Session IMManager::message2session(const Message &val){
    Session session;
    session.m_id = val.sender;
    session.content = val.content;
    session.timestamp = val.timestamp;
    session.type = val.type;
    return session;
}

// QList<Session> IMManager::getSessionList(){
//     return ;
// }

void IMManager::updateSession(Session session){
    QList<Session> data;
    data.append(session);
    Q_EMIT sessionChanged(data);
}
